<template>
	<view>
		<view class="content" @tap="look(item)">
			<text>收件人======></text>
			<text>{{name}}</text><br>
			
			<view class="tel">
				<text >电话======></text>
				<text>{{tel}}</text><br>
			</view>
			
			<view class="tel">
				<text >所在地区======></text>
				<text>{{cityStr}}</text><br>
			</view>
			
			<view class="tel">
				<text >所在地区======></text>
				<text>{{cityBak}}</text><br>
			</view>
			
			
			<view class="set" @tap="mo">
				设置默认地址
				 
			</view>
			
			<view class="switch">
			   <switch name="switch" />
			</view>
			
			<view class="delete" @tap="del">
				<text>删除收获地址</text>
			</view>
			
		</view>
	</view>
</template>

<script>
	import { del,setOne } from "../../../util/goods/index.js"
	export default {
		data() {
			return {
				name:'',
				tel:'',
				cityStr:'',
				cityBak:'',
				id:''
			};
		},
		
		onLoad(option) {
			const val = JSON.parse(decodeURIComponent(option.id));
			console.log(val)
			this.name=val.name
			this.tel=val.tel
			this.cityStr=val.cityStr
			this.cityBak=val.cityBak
			this.id=val.id
			
			
			
		},
		methods:{
			del(){
				uni.showModal({
					title:"删除提醒",
					content:"你将删除这个收货地址?",
					duration:2000
				})
				// del({
				//     id:this.id
				// }).then(res=>{
				// 	console.log(res)
				// 	// this.userList=res.data.data
				// })
			},
			
			mo(){
				setOne({
					userId:'6565e2ca994e4defa45099712fb0342f',
					id:this.id
				}).then(res=>{
					console.log(res)
				})
			},
			
			
			
		},
	}
</script>

<style lang="scss" scoped>
.content{
	width: 100%;
	height: 800px;
	background-color:#f1ece7;
}
.tel{
	margin-top: 40px;
}
.set{
	margin-top: 20px;
}
.switch{
	margin-left: 260px;
	margin-top: -20px;
}
.delete{
	width: 200px;
	height: 50px;
	background-color: #8c8c8c;
	margin-left: 90px;
	margin-top: 30px;
	text{
		line-height: 50px;
		margin-left: 50px;
	}
}
</style>
